﻿/*
 * 
 *	C# object representation of row in 'researchRepo.disciplines' table:
 *	
 *	Currently a simple mapping of all table columns to equivalent properties,
 *	though the class might be expanded to track appropriate relationships with other tables.
 * 
 */

namespace ResearchRepository.Models
{
	public class RRDiscipline
	{
		public RRDiscipline(int dID, int superDID, string dName)
		{
			DiscId = dID;
			SuperDiscId = superDID;
			DiscName = dName;
		}
		public RRDiscipline(RRDiscipline source)
			:this(source.DiscId,
					source.SuperDiscId,
					source.DiscName)
		{}
		public RRDiscipline(System.Data.IDataRecord source)
			:this((int) source["discID"],
					(int) source["superDiscID"],
					(string) source["discName"])
		{}

		// named alias for constructor, provides handle to simulate a function pointer to constructor
		public static RRDiscipline construct(System.Data.IDataRecord source)
		{
			return new RRDiscipline(source);
		}

		public int DiscId { get; set; }
		public int SuperDiscId { get; set; }
		public string DiscName { get; set; }
	}
}